Skip to content

Replication Implementation#20

Open
ryandielhenn wants to merge 5 commits intomainfrom
feat/replication
Open

Replication Implementation#20
ryandielhenn wants to merge 5 commits intomainfrom
feat/replication

Conversation

@ryandielhenn
Copy link
Copy Markdown
Owner

@ryandielhenn ryandielhenn commented Mar 22, 2026

Changes made

This PR implements replication.

Added /replica endpoint to differentiate coordination from writes.

Changed Put/Delete in http_handlers.go to coordinate writing/deleting replicas.

Added PutReplica/DelReplica to differentiate write only steps that are done when targeting the /replica endpoint

PUT

  • Builds a new PUT request that targets with the /replica endpoint.
  • Put now uses ReplicasForKey instead of OwnerForKey (LookupN used internally instead of Lookup).
  • PutReplica used by /replica endpoint to write the key/value

DELETE

  • Builds a new DELETE request that targets with the /replica endpoint.
  • Delete now uses ReplicasForKey instead of OwnerForKey (LookupN used internally instead of Lookup).
  • DelReplica used by /replica endpoint to delete the key

GET

  • Changes out of scope for this PR.
  • Get uses OwnerForKey to look up the owner which always returns the next logical owner in the ring.
    • For example we have owner node A with a replica on node B. If node A crashes the gossip protocol marks it DEAD and it is removed it from every alive node's ring.
    • Next time OwnerForKey is called, the ring doesn't have A anymore, so it returns that B is the owner.

Fixes #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add replication support for write operations

1 participant